<template>
  <div class="main">
    <el-container>
      <el-aside :width="isCollapse ? '60px' : '210px'">
        <MainMenu :isCollapse="isCollapse" />
      </el-aside>
      <el-container>
        <el-header height="50px">
          <MainMeader @fold-change="handleFoldChange" />
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import MainMenu from '@/components/main-menu/main-menu.vue'
import MainMeader from '@/components/main-header/main-header.vue'
import { ref } from 'vue'
const isCollapse = ref(false)
function handleFoldChange(isFold: boolean) {
  isCollapse.value = isFold
  console.log(isCollapse.value)
}
</script>

<style lang="less" scoped>
.main {
  height: 100%;

  .el-container {
    height: 100%;

    .el-aside {
      overflow-x: hidden;
      overflow-y: auto;
      line-height: 200px;
      text-align: left;
      cursor: pointer;
      transition: width 0.3s linear;
      // 这个属性可以使得滚动条隐藏
      scrollbar-width: none;
    }
    &::-webkit-scrollbar {
      display: none;
    }

    .el-main {
      background-color: #f2f3f7;
    }
  }
}
</style>
